<table>
    <thead>
        <tr>
            <th><?php echo __('Title') ?></th>
            <th><?php echo __('Content') ?></th>
            <th><?php echo __('From User') ?></th>
            <th><?php echo __('To user') ?></th>
            <th><?php echo __('Statues') ?></th>
            <th><?php echo __('At') ?> </th>
        </tr>
    </thead>
    <tbody>
        <?php $messages = $pager->getResults(); ?>
        <?php foreach ($messages as $message): ?>
            <tr>
                <td><?php echo $message->getTitle() ?></td>
                <td><?php echo $message->getContent() ?></td>
                <td><?php echo $message->getUser() ?></td>
                <td><?php if($message->getToUser()) echo $message->getToUser(); else echo __('Maneger')  ?></td>
                <td><?php echo __(Message::$statues[$message->getStatues()]) ?></td>
                <td><?php echo $message->getCreatedAt() ?></td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<?php include_partial('global/pager', array('pager'     => $pager, 'routeName' => 'ShowMessages')) ?>